<template>
  <div class="j_item"  @click="goAlbum">
    <div class="img">
      <slot></slot>
    </div>
    <div class="info">
      <div class="title">{{ title }}</div>
      <div class="des">{{ salePoint }}</div>
      <div class="btn">
        <div class="cate"><van-icon name="qr" />&nbsp;{{ categoryName }}</div>
        <div class="play" v-if="countInfo">
          <i class="font_family icon-a-24gl-play"></i>&nbsp;&nbsp;{{
            countInfo.playCount | getCount  
          }}
        </div>
        <div class="track" v-if="countInfo">
          <i class="font_family icon-shengyin_o"></i>&nbsp;<span
            >{{ countInfo.trackCount | getCount}}</span
          >
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  props: {
    id: {
      type: Number,
    },
    img: {
      type: String,
    },
    title: {
      type: String,
    },
    des: {
      type: String,
    },
    countInfo: {
      type: Object,
    },
    categoryName: {
      type: String,
    },
    salePoint: {
      type: String,
    },
  },
  methods: {
    goAlbum() {
      console.log("跳转")
      if(this.$route.path.includes('/album/')){
            this.$router.push('/album/'+this.id)
            this.$router.go(0)
        }else{
            this.$router.push('/album/'+this.id)
        }
    },
  },
};
</script>

<style lang="scss" scoped>
.j_item {
  padding: 15px 10px 15px 0;
  width: 100%;
  display: flex;
  .img {
    width: 75px;
    height: 75px;
    border-radius: 4px;
    overflow: hidden;
    background: url(../../../assets/icon/common/img_load.png) no-repeat;
    background-size: 100% 100%;
    > img {
      width: 100%;
      height: 100%;
    }
  }
  .info {
    flex: 1;
    height: 75px;
    padding-left: 15px;
    .title,
    .des {
      width: 260px;
      white-space: nowrap;
      text-overflow: ellipsis;
      overflow: hidden;
    }
    .title {
      font-size: 16px;
      color: #333;
    }
    .des {
      font-size: 14px;
      color: #999;
      margin: 4px 0 10px;
    }
    .btn {
      display: flex;
      align-items: center;
      div {
        color: #999;
        font-size: 12px;
        height: 12px;
        line-height: 12px;
        // align-items: center;
      }
      .play {
        margin: 0 9px 0 23px;
      }
      .track{
        height: 16px;
        margin-top: 1px;
        padding-top: 1px;
      }
    }
  }
}
</style>

